<!--#include file="./header.inc"-->
<%
dim kind, appName, cacheContent
appName = trim(request("appName"))

select case aq
	case "clean" 		: 	call clean
	case "detail" 		: 	call detail
	case "save" 		: 	call save
	case else 			: 	call index
end select

call db.close()

function index()
	kind = app.int(request("kind"))
	title = "网站缓存"
	if kind = 1 then
	    title = "服务器缓存"
	end if
	%><!--#include file="./view/cache.index.html"--><%
end function

function detail()
	if appName = "" then admin.message "缓存名为空"
	data = application(appName)
	%><!--#include file="./view/cache.detail.html"--><%
end function

function save()
	cacheContent = trim(request("cacheContent"))
	if appName = "" then admin.message "缓存名不能为空"
	if cacheContent = "" then admin.message "缓存值不能为空"
	data = application(appName)
	application.lock
    application(appName) = cacheContent
    application.unLock
    admin.back "修改成功", "返回列表首页", "?q=index"
end function

function clean()
	if appName <> "" then
		app.appCacheDelete appName
		admin.message "清除" & appName & "缓存成功！"
	else
		admin.updateWebAllData()
		admin.message "清除所有缓存成功！"
	end if
end function

%>